<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" xml:lang="{$site.http_equiv.Content-language|wash}" lang="{$site.http_equiv.Content-language|wash}">
<head>
	{def $node_id = $module_result.node_id
		$current_node = fetch('content', 'node', hash( 'node_id', $node_id ))
		$sitename = ezini('SiteSettings','SiteName')
		$level2_node = array()
		$subpage_count = 0
		$pagedesign_class = fetch( 'content', 'class', hash( 'class_id', 'template_look' ) )
		$pagedepth		= $module_result.path|count
		$section_id		= $module_result.section_id
	}
	
	{if $pagedesign_class.object_count|eq( 0 )|not}
	    {def $pagedesign = $pagedesign_class.object_list[0]}
	{/if}
	{if $pagedepth|gt(1)}
		{set $level2_node = fetch('content', 'node', hash( 'node_id', $module_result.path[1].node_id ))
			$subpage_count = fetch( 'content', 'list_count', hash( 'parent_node_id', $level2_node.node_id,
				'class_filter_type', 'include',
				'class_filter_array', ezini( 'MenuContentSettings', 'LeftIdentifierList', 'nxtri.ini' ) ) )}
		{if and( $subpage_count|gt(0), $level2_node.class_identifier|eq('video_page')|not ) }
		    {def $submenu_classname = "has_submenu"}
		{/if}
	{/if}
	

		{include uri="design:page_head.tpl"}
	{ezcss_load(array('websitetoolbar.css','edit.css','main.css'))}
	{ezscript_load(
		array('ezjsc::jquery',
			'jquery.twitter.js',
			'thickbox.js',
			'nxtri.js',
			ezini('JavaScriptSettings','JavaScriptList','design.ini'),
			ezini('JavaScriptSettings','FrontendJavaScriptList','design.ini')
	))}
	<meta property="fb:admins" content="{$pagedesign.data_map.fb_admin.data_text|wash}" />
</head>
<body class="{if $node_id|ne(2)}subpage{/if}{if is_set( $submenu_classname )} submenu{/if}" {if $pagedesign.data_map.bg_img_rel.has_content}style="background-image: url({$pagedesign.data_map.bg_img_rel.content.main_node.data_map.image.content['original'].url|ezroot(no)});"{/if}>
	<div id="bg">
	{def $user_hash = concat( $current_user.role_id_list|implode( '_' ), '_', $current_user.limited_assignment_value_list|implode( '_' ) )}

	{cache-block keys=array( $uri_string, $user_hash )}

	    {include uri='design:parts/website_toolbar.tpl' current_node_id=$module_result.node_id}

	{/cache-block}
		{if $pagedesign.data_map.info_top.has_content}
		<div class="top-info">{attribute_view_gui attribute=$pagedesign.data_map.info_top}</div>
		{/if}
		<div id="page">
			
			{include uri="design:menu/flat_top.tpl"}
			
			<div id="content">
				{if is_set( $submenu_classname )}
				<div id="subnav">
					{include uri="design:menu/sub_left.tpl"}
				</div>

				{/if}
				<div id="main">
				{def $no_crump = array('frontpage', 'live_page')}
					{if $no_crump|contains($current_node.class_identifier)|not}
						<div id="breadcrumb"> 
							{include uri="design:parts/path.tpl"}
						</div>
					{/if}
					
					<!-- Content start -->
					{$module_result.content}
					<!-- Content end -->
				</div><!--end #main -->
				<div id="sidebar">
					{def $partner = array()}
					
					{* 1. Title sponsor *}
					{if $pagedesign.data_map.partners_1.has_content}
					<div class="partner">
					<strong class="title">Title sponsor</strong>
					{foreach $pagedesign.data_map.partners_1.content.relation_list as $Relations}
					{set $partner = fetch( content, node, hash( node_id, $Relations.node_id ) )}
					{if $partner.data_map.image.has_content}
						<a href={$partner.url_alias|ezurl()} class="partner">
							{attribute_view_gui attribute=$partner.data_map.image image_class=partnerlogo}
						</a>
					{/if}
					{/foreach}
					</div>
					{/if}
					
					{* 2. Our partners *}
					{if $pagedesign.data_map.partners_2.has_content}
					<div class="partner">
					<strong class="title">Our sponsors</strong>
					{foreach $pagedesign.data_map.partners_2.content.relation_list as $Relations}
					{set $partner = fetch( content, node, hash( node_id, $Relations.node_id ) )}
					{if $partner.data_map.image.has_content}
						<a href={$partner.url_alias|ezurl()} class="partner">
							{attribute_view_gui attribute=$partner.data_map.image image_class=partnerlogo}
						</a>
					{/if}
					{/foreach}
					</div>
					{/if}
					
					
					{* 3. Our partners *}
					{if $pagedesign.data_map.partners_3.has_content}
					<div class="partner">
					<strong class="title">Our partners</strong>
					{foreach $pagedesign.data_map.partners_3.content.relation_list as $Relations}
					{set $partner = fetch( content, node, hash( node_id, $Relations.node_id ) )}
					{if $partner.data_map.image.has_content}
						<a href={$partner.url_alias|ezurl()} class="partner">
							{attribute_view_gui attribute=$partner.data_map.image image_class=partnerlogo}
						</a>
					{/if}
					{/foreach}
					</div>
					{/if}
					
					{* 4. Media partner *}
					{if $pagedesign.data_map.partners_4.has_content}
					<div class="partner">
					<strong class="title">Media partner</strong>
					{foreach $pagedesign.data_map.partners_4.content.relation_list as $Relations}
					{set $partner = fetch( content, node, hash( node_id, $Relations.node_id ) )}
					{if $partner.data_map.image.has_content}
						<a href={$partner.url_alias|ezurl()} class="partner">
							{attribute_view_gui attribute=$partner.data_map.image image_class=partnerlogo}
						</a>
					{/if}
					{/foreach}
					</div>
					{/if}

					{* 5. Our official charity *}
					{if $pagedesign.data_map.partners_5.has_content}
					<div class="partner">
					<strong class="title">Our official charity</strong>
					{foreach $pagedesign.data_map.partners_5.content.relation_list as $Relations}
					{set $partner = fetch( content, node, hash( node_id, $Relations.node_id ) )}
					{if $partner.data_map.image.has_content}
						<a href={$partner.url_alias|ezurl()} class="partner">
							{attribute_view_gui attribute=$partner.data_map.image image_class=partnerlogo}
						</a>
					{/if}
					{/foreach}
					</div>
					{/if}
				</div><!--end #sidebar -->
			</div><!--end #content -->
			<div id="footer">
				<div class="holder">
					<div class="social">
						<a href="http://www.facebook.com/nxtri" class="fb-ico" rel="external">Norseman on facebook</a>
						<a href="http://twitter.com/nxtri" class="twit-ico" rel="external">Norseman on Twitter</a>
						<a href="http://www.youtube.com/nxtri" class="youtube-ico" rel="external">Norseman on YouTube</a>
						<a href="http://www.flickr.com/photos/nxtri/collections/" class="flickr-ico" rel="external">Norseman on Flickr</a>
					</div>
					{if $pagedesign.data_map.footer_text.has_content}
					    <p>{$pagedesign.data_map.footer_text.content}</p>
					{/if}
					<p class="credit">
						<a href="http://www.metabits.no" rel="external">Design and ez publish development by Metabits</a> | <a href="http://www.ez.no" rel="external">Powered by Ez publish</a> 
					</p>
				</div>
			</div><!--end #footer -->
		</div><!--end #page -->
		<div id="header">
			<strong class="logo"><a href={"/"|ezurl}>{$sitename}</a></strong>
			{if and($pagedesign.data_map.show_twitter.data_int, $node_id|eq(2))}
			<div class="twit-hold">
				<div class="twit-logo"></div>
				<div id="twitter"></div>
			</div>
			{/if}
		</div>
	</div><!--end #bg -->
	{if $pagedesign.data_map.footer_script.has_content}
	    {$pagedesign.data_map.footer_script.content}
	{/if}
		
	</body>
</html>
